<div class="campushome-container">
	<div class="home-right">
    	<div class="main-search-box">
			<% form_tag url_for(:controller=>"listings",:action => "general_search")  do -%>
			<div class="main-search-text2">
				I am Looking for
		  	</div>
		  	<div class="main-search-input2">
				<input value="E.g. Jobs,PG,Books,CAT Coachings etc." id="keyword" name="keyword" class="search-input-box2" type="text"  onclick="if(this.value=='E.g. Jobs,PG,Books,CAT Coachings etc.'){this.value=''};"/>
                                <input type="hidden" name="cityname" value="<%=params[:city]%>" />
		  	</div>
		  	<div class="main-search-button">
				<%=image_submit_tag "search-button.jpg"-%>
		  	</div>
			<%end-%>
		</div>
        <div class="right-column-one">
          <%@user_types.each do |all_categories|%>
           <%@category=Category.find(all_categories.category_id.to_s)%>
	   		<div class="links">
         		<div class="category">
                	<div class="category-image">
                    	<%=image_tag @category.stripped_name+".png",:border=>0,:height=>20 -%>
                    </div>
                    <div class="category-text">
                    	<%= link_to h(@category.name), { :controller=> "listings", :action => "city" ,:category => @category.stripped_name , :city=>@city.stripped_name},:class=>"no_decoration" -%>
                    </div>
                </div>
         		
                	
					<%@sub_categories=SubCategory.find(:all,:conditions=>"category_id="+@category.id.to_s)-%>
                    <%@sub_categories.each do |sub_category| %>
                   <div class="sub-category">
				   <%= link_to h(sub_category.name), { :controller=> "listings", :action => "city",:category=>@category.stripped_name,:sub_category=>sub_category.stripped_name, :city =>@city.stripped_name, :user_profile => params[:user_profile]} -%>
					</div>
                    <%end%>
			   	</div>

            <%end -%>
		</div>
        <div class="right-column-two">
	    	<%require 'htmlentities'
coder = HTMLEntities.new
%>


<div class="column-two-heading">Latest on SearchMyCampus</div>
    <%@user_types.each do |all_categories|%>
      <%@category=Category.find(all_categories.category_id.to_s)%>
      <%if @category.name!='Events' -%>
      <div class="column-boxes">

           <div class="post-tabs-heads">
                	<ul>
                        <li class="post-tabs-selected"><%= link_to h(@category.name), { :controller=> "listings", :action => "city" ,:category => @category.stripped_name , :city=>@city.stripped_name},:class=>"no_decoration" -%></li>
                    </ul>
          </div>
            <div class="post-tabs-posts">
          <ul>
            <%@universities=University.find(:all,:conditions=>"city_id="+@city.id.to_s)-%>
            <%@university_ids=Array.new%>
            <%@universities.each do |u| %>
            <%@university_ids <<  u.id.to_s -%>
            <%end -%>
          
           
            <%@ads = @category.advertisments.find(:all,:limit=>3,:conditions =>{ :university_id => @university_ids},  :order=>"created_at DESC") %>
            
             <%@ads.each do |ad|%>

               
                 
                    <% @sub_category_name=SubCategory.find(ad.sub_category_id).name -%>

               <li>
                  <div class="latest-post-ads">
		              <div class="latest-post-ads-headings">
                               		<%= link_to h(coder.decode(excerpt(ad.title , '', 20))), {:controller =>"advertisments", :action=>"show" , :id=> ad.id } -%>

                       </div>
			           <div class="latest-post-ads-sub">
                                	<%=@category.name-%>/<%=@sub_category_name-%>

                        </div>
                        <div class="latest-post-ads-date">
                                	<%= ad.created_at.to_formatted_s(:long_ordinal) %>
                        </div>
                  </div>
               </li>
               
            
                      
                     
                  <%end%>
              </ul>
          
               <div class="more-ads">
                    	<div class="more-ads-text">
                        	<%= link_to  "More", { :controller=> "listings", :action => "city" ,:category => @category.stripped_name , :city=>@city.stripped_name},:class=>"no_decoration" -%>
                        </div>
                        <div class="more-ads-image">
                         <%= link_to (image_tag "more-ads.png",:width=>"6",:border=>0), { :controller=> "listings", :action => "index" ,:category => @category.stripped_name , :city=>@city.stripped_name},:class=>"no_decoration" -%>
                        </div>
                </div>
          </div>
       </div>
      <%end -%>
      <%end%>
  <div style="clear:both;">&nbsp;</div>

	     		</div>
     		</div>
             <div class="home-left">
    	 <div class="sign-in">
	     	<div class="sign-in-header">
		 		Student Sign In
				<a href="">New User?</a>
		 	</div>
            <div class="sign-in-inner">
              <% form_tag(:controller=>"login",:action => "process_login") do %>
                 <div class="username">
                	<div class="username-text">
	                	Username:
    				</div>
                    <div class="username-value">
                    	<%= text_field "user", "name",:class=>"input-box",:maxlength=>"80",:size=>"26" -%>&#x00A;
                    </div>
                </div>
                <div class="password">
                    <div class="password-text">
                    	Password:
                    </div>
                    <div class="password-value">
                    	<%= password_field "user", "password",:class=>"input-box",:maxlength=>80,:size=>26 -%>&#x00A;
                    </div>
                </div>
                <div class="sign-in-button">
                   <%= image_submit_tag "sign-in-button.jpg" -%>
                </div>
                <div class="sign-in-problem">
                	<a href="">Forgot Password?</a>
                </div>
                <div class="sign-in-problem">
                	 <a href="">Not a Student?</a>
                </div>
                <% end %>
			</div>
        </div>
        <!--<div class="new-user">
	     	<div class="new-user-header">
		 		New User?
		 	</div>
            <div class="new-user-inner">
               <% form_tag(:controller=>"registration",:action => "step1",:city=>params[:city]) do %>
                <div class="new-user-email">
                	<div class="new-user-email-text">
	                	Email ID:
    				</div>
                    <div class="new-user-email-value">
                        <%= text_field "user", "email",:class=>"input-box",:maxlength=>"80",:size=>"26" -%>&#x00A;
                    </div>
                </div>
                <div class="new-user-mobile">
                	<div class="new-user-mobile-text">
	                	Mobile No:
    				</div>
                    <div class="new-user-mobile-value">
                    	<%= text_field "user", "mobile_no",:class=>"input-box",:maxlength=>"80",:size=>"26" -%>&#x00A;
                   </div>
                </div>
                <div class="sign-in-button">
                    <%= image_submit_tag "create-account-button.jpg" -%>
                </div>
                <div class="sign-in-problem">
                	<a href="">Not a student?</a>
                </div>
                <%end -%>
			</div>
        </div>
        <div class="right-boxes">
	     	<div class="right-boxes-header">
		 		Popular Searches
		 	</div>
            <div class="right-boxes-inner">
            PGs Hudsonlane Tutions saket Part time jobs internship paying guest Nokia mobiles Fresher Jobs online data Engineer Reliance Hostel DU admission
            </div>
    	</div>
		<div class="latest-listing">
	     	<div class="latest-listing-header">
		 		Latest listings by Email
		 	</div>
            <div class="latest-listing-inner">
                <div class="latest-listing-email">
                	<div class="latest-listing-email-text">
	                	Email ID:
    				</div>
                    <div class="latest-listing-email-value">
                    	  <%= text_field "user", "email",:class=>"input-box",:maxlength=>"80",:size=>"26" -%>&#x00A;
                    </div>
    			</div>
                <div class="sign-in-button">
                  <%= image_submit_tag "latest-listing-button.jpg" -%>
               </div>
    		</div>
    	</div>-->
        <div class="user-speaks">
			<div class="user-speaks-header">
            	User Speak
            </div>
            <div class="user-speaks-inner">
                <div class="user-speaks-text">
                	&quot;I've found a job I love, in an industry that is totally related to what I did in college, all because of SearchMy Campus.&quot;
                	<div class="user-speaks-name">
                    	<br/>Aarti Sharma<br/>
                        Delhi city
                    </div>
                </div>
			</div>
        </div>
        <!--<div class="things-to-do">
          <%=image_tag "thingsyoucando.jpg",:width=>298,:border=>0,:alt=>"search my campus" -%>
	     </div>
        <div class="right-boxes">
	     	<div class="right-boxes-header">
		 		How to use SearchMyCampus
		 	</div>
            <div class="right-boxes-inner">
            	Tips and info on how to use SearchMyCampus
            </div>
    	</div>-->
	</div>
</div>
                     